package song;

import drumkit.Drum;

import java.util.ArrayList;

/**
 * Created by IntelliJ IDEA.
 * User: Aleksey
 * Date: 02.01.2008
 * Time: 18:53:07
 */
public class DrumSubTrack {
    private Drum drum;
    private Integer position;

    private ArrayList<Bar> bars;

    public DrumSubTrack(Drum drum, Integer position) {
        this.drum = drum;
        this.position = position;
        bars = new ArrayList<Bar>();
    }

    public Drum getDrum() {
        return drum;
    }

    public void setDrum(Drum drum) {
        this.drum = drum;
    }

    public Integer getPosition() {
        return position;
    }

    public void setPosition(Integer position) {
        this.position = position;
    }

    public Integer getBarCount() {
        return bars.size();
    }

    public void addBar(Bar bar) {
        bars.add(bar);
    }

    public Bar getBar(Integer index) {
        return bars.get(index);
    }

    public void deleteBar(Integer index) {
        bars.remove(index.intValue());
    }

    public void insertBar(Integer index, Bar bar) {
        bars.add(index, bar);
    }
}
